Release 10.1A: OpenEdge Getting Started:
Progress OpenEdge Studio


Detailed Customer section procedure

The following sections lead you through assembling the Customer section in more detail.

Adding a SDO

The first SmartObject added in most applications is the SDO that acts as a data source for the rest of the application’s SmartObjects.

To add a SDO:

  1. Choose the SDO icon in the Object Palette. The Choose SmartDataObject dialog box appears:
  2. Select dcust.w and choose OK.
  3. Move the pointer over the Customer section. Note that your pointer resembles the SDO icon.
  4. Click once in the Customer section. You do not need to establish an exact position for an SDO because it is invisible when the application is running. The new SDO appears in the Customer section:
Adding a SDV

Next, you need to add an SDV. The SDV displays the customer information retrieved by the SDO.

To add a SDV:

  1. Choose the SDV icon in the Object Palette. The Choose SmartDataViewer dialog box appears:
  2. Select vcust.w and choose OK.
  3. Click once in the Customer section. Note that the pointer now resembles the SDV icon. The Progress Advisor notifies you that the SDV instance, h_vcust, should be a data target for another SmartObject, and offers to create a Data SmartLink from the SDO instance, h_dcust:
  4. Note: The Progress Advisor refers to SmartObjects with an h_ prefix to indicate a handle. A handle refers to an instance of a SmartObject in memory. For example, vcust is referred to by its handle, h_vcust.

  5. Select the radio button to create the SmartLink and choose OK. The Progress Advisor notifies you that the SDV instance, h_vcust, should be an Update Source for some other SmartObject, and offers to create an Update SmartLink to the SDO instance, h_dcust:
  6. Select the radio button to create the SmartLink and choose OK. The SDV, vcust, appears in the Customer section.
  7. Position the SDV within the Customer section, aligning it on the right edge of the design window, as shown in the following figure:
  8. Double-click the SDV to open its property sheet:
  9. Choose the SmartLinks button to view the SmartLinks dialog box. It shows a Data SmartLink from h_dcust to h_vcust and an Update SmartLink from h_vcust to h_dcust:
  10. You can check the SmartLinks between your objects with this dailog. You can add, modify, and remove SmartLinks as needed. This allows you to alter how information flows between the SmartObjects in your application.

  11. Close the open dialog box boxes and save your work.

Your next task is to add two buttons to the Customer section, complete with ToolTips, images, and help text.

Creating and positioning the buttons

The first step in adding buttons to your application is to create and position them.

To create and position the buttons:

  1. Double-click the Button icon in the Object Palette.
  2. Click in the Customer section in two places to add two buttons, as shown. You do not need to position the buttons exactly. You will use the Properties Window to specify precise settings later. The main window should look something like the following figure:
  3. Choose the Pointer icon and, holding down the CTRL key, select both buttons.
  4. Choose Window Properties Window from the AppBuilder menu. The Properties Window, which enables quickly setting common attributes in many objects at once, appears:
  5. Double-click the Geometry row to expand its options:
  6. Note: In this Properties Window, you can only change one value at a time. Select a row, type a value in the fill-in field next to the check-mark button, and then choose the check-mark to commit the change.

  7. Set the following attributes for the buttons:
  8. Attribute
    Value
    Left
    14
    Height
    2.38
    Width
    10

    When you finish, the window should looks like this:

  9. Close the Properties Window and manually adjust the buttons’ vertical positions to resemble the following figure:
Adding ToolTips, help IDs, and images to the buttons

After creating and positioning the buttons, you are ready to add a ToolTip, a Help ID, and an image to each button.

To add ToolTips, help IDs , and images the buttons:

  1. Open the property sheet for BUTTON-1 and set the following properties:
  2. Property
    Value
    Tooltip
    Find Customer
    Help ID
    1

  3. Choose the Up button in the Images section. The Choose Image dialog box appears.
  4. Select Findcust.jpg from <wrk>\images, where <wrk> is your OpenEdge working directory. The button’s property sheet now looks like this:
  5. Repeat the procedure for BUTTON-2, setting the following properties:
  6. Property
    Value
    Tooltip
    Maintain Customer
    Help ID
    2
    Up Image
    mntcust.jpg

    When you finish, your window should appear as follows:

Adding online help to the window

Now that you have added Help IDs, you can link a context-sensitive help file to your application. Help files are added to the window. All of the simple objects on that window reference the same context-sensitive help.

To add a context-sensitive help file:

  1. Choose the List Object icon on the AppBuilder toolbar. The List Objects dialog box appears:
  2. Select wWin from the Name list to select the window object.
  3. Choose the Object Properties icon in the AppBuilder toolbar to open the window’s property sheet:
  4. Choose the Context Help toggle-box to activate context sensitive help.
  5. Type sports2000.hlp in the Help File field and choose OK.
  6. Close the List Objects dialog box and save your window.
Coding event triggers for the buttons

Your next step is to add code to the buttons. When the user clicks on either button, a CHOOSE event occurs. Using the Section Editor, you can quickly add code to launch the appropriate module when each CHOOSE event occurs.

To add the trigger code to the buttons:

  1. Select BUTTON-1 and choose the Edit Code icon in the AppBuilder toolbar. The Section Editor appears:
  2. Between the DO and END statements, add the following code:
  3. RUN wfndcust.w  (h_dcust). 
    

    Note: This statement passes the handle for the dcust SDO to the module you are starting. As a result, the new module opens on the same customer record. Because the new module does not have an internal data source, it cannot run on its own.

  4. Select BUTTON-2 in the combo box of objects:
  5. Between the DO and END statements, add the following code:
  6.  RUN wmntcust.w (h_dcust). 
    

  7. Choose File Close Window to save the new code and return to the workspace.
  8. Note: If you do not want to save code that you entered in the Section Editor, you must use the Edit Undo menu options.

  9. Save your work.

Now that you have built the Customer section of the SmartWindow, you can add SmartObjects to the Order section.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095